# $Id: PKGBUILD,v 1.7 2009/04/11 00:48:20 BaSh Exp $
# Maintainer: Andrea Scarpino <andrea@archlinux.org>

pkgname=vuze-archlive
_realpkgname=vuze
pkgver=4.2.0.2
pkgrel=1
pkgdesc="BitTorrent client with GUI, written in Java, formerly known as Azureus"
arch=('i686' 'x86_64')
url="http://azureus.sourceforge.net/"
license=('GPL')
depends=('java-runtime')
optdepends=('xulrunner: needed for browsing the vuze content')
provides=('azureus')
conflicts=('azureus' 'java-gcj-compat')
replaces=('azureus')
source=("http://downloads.sourceforge.net/azureus/Vuze_${pkgver}_linux.tar.bz2"
	'vuze.desktop')
md5sums=('c513dc751e1f28515399be3c087cb492')
[ "${CARCH}" = "x86_64" ] && \
  source[0]="http://downloads.sourceforge.net/azureus/Vuze_${pkgver}_linux-x86_64.tar.bz2" && \
  md5sums[0]='d5d9b4c0b545d4709956904d5c26f5ec'

build() {
  cd ${srcdir}

  install -d "$pkgdir/usr/share"
  cp -r vuze "$pkgdir/usr/share" || return 1

  install -D -m755 vuze/vuze "$pkgdir/usr/bin/vuze" || return 1
  sed -i 's%#PROGRAM_DIR="/home/username/apps/azureus"%PROGRAM_DIR="/usr/share/vuze"%' "$pkgdir/usr/bin/vuze" || return 1
  sed -i 's%JAVA_PROGRAM_DIR=""%JAVA_PROGRAM_DIR="/opt/java/jre/bin/"%' "$pkgdir/usr/bin/vuze" || return 1
  install -D -m644 vuze/vuze.png "$pkgdir/usr/share/pixmaps/vuze.png"|| return 1
  install -D -m644 vuze.desktop  "$pkgdir/usr/share/applications/vuze.desktop" || return 1
  chmod 777 $pkgdir/usr/share/vuze
}
